Bug 532059 - Leak in win32 clipboard manipulation
authorTor Lillqvist <tml@novell.com>
Mon, 12 May 2008 07:05:40 +0000 (07:05 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Mon, 12 May 2008 07:05:40 +0000 (07:05 +0000)
2008-05-12  Tor Lillqvist  <tml@novell.com>

Bug 532059 - Leak in win32 clipboard manipulation

* gdk/win32/gdkselection-win32.c
(gdk_win32_selection_add_targets): Plug memory leak. Patch by
Daniel Atallah.

svn path=/trunk/; revision=20092

ChangeLog
gdk/win32/gdkselection-win32.c

index 79b4ce49892c46ddcddf97db456c0145496db3ef..d11106ccb45d5202d78c32d616e75e375076d6d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-05-12  Tor Lillqvist  <tml@novell.com>
+
+       Bug 532059 - Leak in win32 clipboard manipulation
+
+       * gdk/win32/gdkselection-win32.c
+       (gdk_win32_selection_add_targets): Plug memory leak. Patch by
+       Daniel Atallah.
+
 2008-05-11  Yair Hershkovitz  <yairhr@gmail.com>
 
        * gtk/gtkmain.c: call g_i18n_init() in gettext_initialization(). do
index 63e2c24c3f3817fe6bcbae7c68ebdccddce892c0..01e2d7f58fe4ad28e5081c84acc8f36d6df13e8e 100644 (file)
@@ -1121,10 +1121,11 @@ gdk_win32_selection_add_targets (GdkWindow  *owner,
        {
          gchar **mime_types =
            gdk_pixbuf_format_get_mime_types ((GdkPixbufFormat *) format->data);
+         gchar **mime_type;
 
-         for (; *mime_types; ++mime_types)
+         for (mime_type = mime_types; *mime_type; ++mime_type)
            {
-             if (!strcmp (target_name, *mime_types))
+             if (!strcmp (target_name, *mime_type))
                {
                  g_hash_table_replace (_format_atom_table,
                                        GINT_TO_POINTER (CF_DIB),
@@ -1135,6 +1136,7 @@ gdk_win32_selection_add_targets (GdkWindow  *owner,
                  break;
                }
            }
+         g_strfreev(mime_types);
        }
       g_free (target_name);
     }